package com.yanggeng.demo.beginnerguidedemo.bean;

import java.io.Serializable;

/**
 * 行驶里程统计实体
 * @user: yanggeng
 * @date: 2017/12/15 9:44
 */
public class MileageStatisticsBean implements Serializable {

    private Long id;


    private String userCode;
    private String flag; // 查询类型 1代表日，2代表周，3代表月，4代表年
    private String date; // 插入时间
    private String time; // 时间
    private double miles; // 总里程
    private int driveBehaviorCount; // 不当驾驶行为次数
    private int driveCount; // 驾驶次数
    private int driveDays; // 驾驶天数
    private long driveTime; // 驾驶时长

    public MileageStatisticsBean() {
    }

    public MileageStatisticsBean(String time, double miles) {
        this.time = time;
        this.miles = miles;
    }

    public MileageStatisticsBean(Long id, String userCode, String flag, String date,
                                 String time, double miles, int driveBehaviorCount, int driveCount,
                                 int driveDays, long driveTime) {
        this.id = id;
        this.userCode = userCode;
        this.flag = flag;
        this.date = date;
        this.time = time;
        this.miles = miles;
        this.driveBehaviorCount = driveBehaviorCount;
        this.driveCount = driveCount;
        this.driveDays = driveDays;
        this.driveTime = driveTime;
    }

    @Override
    public String toString() {
        return "MileageStatisticsBean{" +
                "time='" + time + '\'' +
                ", miles=" + miles +
                ", driveBehaviorCount=" + driveBehaviorCount +
                ", driveCount=" + driveCount +
                ", driveDays=" + driveDays +
                ", driveTime=" + driveTime +
                '}';
    }
//
//    @Override
//    public boolean equals(Object o) {
//        if (this == o) return true;
//        if (o == null || getClass() != o.getClass()) return false;
//
//        MileageStatisticsBean that = (MileageStatisticsBean) o;
//
//        if (Double.compare(that.miles, miles) != 0) return false;
//        return time.equals(that.time);
//
//    }

//    @Override
//    public int hashCode() {
//        int result;
//        long temp;
//        result = time.hashCode();
//        temp = Double.doubleToLongBits(miles);
//        result = 31 * result + (int) (temp ^ (temp >>> 32));
//        return result;
//    }


    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }


    public int getDriveBehaviorCount() {
        return driveBehaviorCount;
    }

    public void setDriveBehaviorCount(int driveBehaviorCount) {
        this.driveBehaviorCount = driveBehaviorCount;
    }

    public int getDriveCount() {
        return driveCount;
    }

    public void setDriveCount(int driveCount) {
        this.driveCount = driveCount;
    }

    public int getDriveDays() {
        return driveDays;
    }

    public void setDriveDays(int driveDays) {
        this.driveDays = driveDays;
    }

    public double getMiles() {
        return miles;
    }

    public void setMiles(double miles) {
        this.miles = miles;
    }

    public long getDriveTime() {
        return driveTime;
    }

    public void setDriveTime(long driveTime) {
        this.driveTime = driveTime;
    }

    public Long getId() {
        return this.id;
    }

    public String getDate() {
        return this.date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getUserCode() {
        return this.userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getFlag() {
        return this.flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setMileageStatisticsBean(MileageStatisticsBean bean) {
        if (null != bean) {
            this.date = bean.getDate();
            this.time = bean.getTime();
            this.driveBehaviorCount = bean.getDriveBehaviorCount();
            this.driveCount = bean.getDriveCount();
            this.driveDays = bean.getDriveDays();
            this.driveTime = bean.getDriveTime();
            this.flag = bean.getFlag();
            this.userCode = bean.getUserCode();
            this.miles = bean.getMiles();
        }
    }
}
